import request from '@/util/http'

// 统一管理前缀
const api = '/sys/user'

export  default {
    login(obj){
        return request({
            method: 'post',
            url: '/user/login',
            data: obj
        })
    },

    getAll(obj){
        return request({
            method: 'GET',
            url: `${api}`,
            params: obj
        })

    },
    deleteUserById(id){
        return request({
            method: 'delete',
            url: `${api}/${id}`
        })
    },

    checkAccount(account) {
        return request({
            method: 'GET',
            url: `${api}/check/${account}`
        })
    },

    insertUser(obj){
        return request({
            method: 'post',
            url: `${api}`,
            data: obj
        })
    },
    updateUserById(obj){
        return request({
            method: 'put',
            url: `${api}`,
            data: obj
        })
    },
    updatePwd(obj){
        return request({
            method: 'put',
            url: `${api}/modifyPwd`,
            data: obj
        })
    }
}